package PTA_JAVA.JavaA.Javademo30;

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        int[] arr=new int[5];
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            String s=sc.next();
            if(s.equals("arr")){
                int b=sc.nextInt();
                try{
                    int i=arr[b];
                }catch(Exception e){
                    System.out.println(e.toString());
                }
            }else if(s.equals("null")){
                try{
                    String i=null;
                    int j=i.length();
                }catch(Exception e){
                    System.out.println(e.toString());
                }
            }else if(s.equals("cast")){
                Object i=new String(s);
                try{
                    System.out.println((Integer) (i));
                }catch(Exception e){
                    System.out.println(e.toString());
                }
            }else if(s.equals("num")){
                String i=sc.next();
                try{
                    Integer j=Integer.valueOf(i);
                }catch(Exception e){
                    System.out.println(e.toString());
                }
            }else{
                System.exit(0);
            }
        }
    }
}
